import request from '@/utils/request'

// 创建商品分类
export function createProductType(data) {
  return request({
    url: '/market/product-type/create',
    method: 'post',
    data: data
  })
}

// 更新商品分类
export function updateProductType(data) {
  return request({
    url: '/market/product-type/update',
    method: 'put',
    data: data
  })
}

// 删除商品分类
export function deleteProductType(id) {
  return request({
    url: '/market/product-type/delete?id=' + id,
    method: 'delete'
  })
}

// 获得商品分类
export function getProductType(id) {
  return request({
    url: '/market/product-type/get?id=' + id,
    method: 'get'
  })
}

// 获得商品分类分页
export function getProductTypePage(params) {
  return request({
    url: '/market/product-type/page',
    method: 'get',
    params
  })
}
export function getProductTypeList() {
  return request({
    url: '/market/product-type/list',
    method: 'get',
  })
}
// 导出商品分类 Excel
export function exportProductTypeExcel(params) {
  return request({
    url: '/market/product-type/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
